﻿<UserControl xmlns:my="clr-namespace:MemoBoss"  
    x:Class="MemoBoss.GameScreen"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:classes="clr-namespace:Classes"
                  xmlns:util="clr-namespace:Util"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"

    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480">
    <UserControl.Resources>
        <Storyboard x:Name="GameTextSB">
          
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_messageText">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuadraticEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:2.5" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuadraticEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="_messageText">
                <LinearDoubleKeyFrame KeyTime="0" Value="-500"/>
                <LinearDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="_messageText">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.3" Value="15"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.35" Value="-12"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.4" Value="10"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.45" Value="-8"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.5" Value="3"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.55" Value="-1"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.65" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="Hide">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="500"/>
            </DoubleAnimationUsingKeyFrames>
            <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>-->
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="LayoutRoot">
                <DiscreteObjectKeyFrame KeyTime="0" >
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="Show"  Completed="Show_Completed">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="500"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
            </DoubleAnimationUsingKeyFrames>-->
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="LayoutRoot">
                <DiscreteObjectKeyFrame KeyTime="0" >
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" util:Clip.ToBounds="true" RenderTransformOrigin="0.5,0.5">
        <Grid.RenderTransform>
            <TranslateTransform/>
        </Grid.RenderTransform>
        <!--<Image Tag="LayerIndex=-30" x:Name="bgImage" Source="bezdzionbomziai.jpg"   Margin="-50" Stretch="UniformToFill" Opacity="0.5" />-->

        <Grid x:Name="ContentPanel" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>


            <!--TitlePanel contains the name of the application and page title-->
            <StackPanel x:Name="GameInfo" Grid.Row="0" Margin="12,5,12,10">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition Width="5*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <Grid Margin="5" Grid.Column="0">
                        <Rectangle  RenderTransformOrigin="0.5,0.5"  Opacity="0.7" >
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource PhoneAccentColor}"></SolidColorBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <TextBlock x:Name="txtElapsed" Tap="Rectangle_Tap"  Margin="5" FontSize="20" TextAlignment="Center">00:35:02</TextBlock>
                    </Grid>
                    <Grid Margin="5" Grid.Column="1">
                        <Rectangle  RenderTransformOrigin="0.5,0.5"  Opacity="0.7">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource PhoneAccentColor}"></SolidColorBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <TextBlock x:Name="txtScore" Margin="5" FontSize="20" TextAlignment="Center" >Score: 150084</TextBlock>
                    </Grid>
                    <Grid Margin="5" Grid.Column="2">
                        <Rectangle  RenderTransformOrigin="0.5,0.5"  Opacity="0.7">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource PhoneAccentColor}"></SolidColorBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <TextBlock x:Name="txtLevel" Margin="5" FontSize="20" TextAlignment="Center" >Level: 20</TextBlock>
                    </Grid>
                </Grid>

                <Grid Height="20" Margin="5">
                    <Rectangle  RenderTransformOrigin="0.5,0.5"  Opacity="0.7">
                        <Rectangle.Fill>
                            <SolidColorBrush Color="{StaticResource PhoneAccentColor}"></SolidColorBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <!--<ProgressBar x:Name="_Timer" Height="28" VerticalAlignment="Center" Value="35" Foreground="{StaticResource PhoneForegroundBrush}" />-->
                    <Rectangle Margin="5" Name="rectangle2" Fill="{StaticResource PhoneForegroundBrush}" RenderTransformOrigin="0,0" >
                        <Rectangle.RenderTransform>
                            <ScaleTransform x:Name="timerTransform"/>
                        </Rectangle.RenderTransform>
                    </Rectangle>
                    
                </Grid>
            </StackPanel>

            <!--ContentPanel - place additional content here-->
            <Grid x:Name="CardsPanel" x:FieldModifier="public" Grid.Row="1" Margin="12,0,12,0" >
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <my:Card Grid.Row="0" Grid.Column="0"/>
                <my:Card Grid.Row="0" Grid.Column="1"/>
                <my:Card Grid.Row="0" Grid.Column="2"/>
                <my:Card Grid.Row="0" Grid.Column="3"/>
                <my:Card Grid.Row="0" Grid.Column="4"/>
                <my:Card Grid.Row="0" Grid.Column="5"/>
                <my:Card Grid.Row="1" Grid.Column="0"/>
                <my:Card Grid.Row="1" Grid.Column="1"/>
                <my:Card Grid.Row="1" Grid.Column="2"/>
                <my:Card Grid.Row="1" Grid.Column="3"/>
                <my:Card Grid.Row="1" Grid.Column="4"/>
                <my:Card Grid.Row="1" Grid.Column="5"/>
                <my:Card Grid.Row="2" Grid.Column="0"/>
                <my:Card Grid.Row="2" Grid.Column="1"/>
                <my:Card Grid.Row="2" Grid.Column="2"/>
                <my:Card Grid.Row="2" Grid.Column="3"/>
                <my:Card Grid.Row="2" Grid.Column="4"/>
                <my:Card Grid.Row="2" Grid.Column="5"/>
                <my:Card Grid.Row="3" Grid.Column="0"/>
                <my:Card Grid.Row="3" Grid.Column="1"/>
                <my:Card Grid.Row="3" Grid.Column="2"/>
                <my:Card Grid.Row="3" Grid.Column="3"/>
                <my:Card Grid.Row="3" Grid.Column="4"/>
                <my:Card Grid.Row="3" Grid.Column="5"/>
                <my:Card Grid.Row="4" Grid.Column="0"/>
                <my:Card Grid.Row="4" Grid.Column="1"/>
                <my:Card Grid.Row="4" Grid.Column="2"/>
                <my:Card Grid.Row="4" Grid.Column="3"/>
                <my:Card Grid.Row="4" Grid.Column="4"/>
                <my:Card Grid.Row="4" Grid.Column="5"/>
                <my:Card Grid.Row="5" Grid.Column="0"/>
                <my:Card Grid.Row="5" Grid.Column="1"/>
                <my:Card Grid.Row="5" Grid.Column="2"/>
                <my:Card Grid.Row="5" Grid.Column="3"/>
                <my:Card Grid.Row="5" Grid.Column="4"/>
                <my:Card Grid.Row="5" Grid.Column="5"/>
            </Grid>
            
        </Grid>
       
        <TextBlock x:Name="_messageText" HorizontalAlignment="Left" TextWrapping="Wrap"  VerticalAlignment="Center"  FontSize="60" TextAlignment="Center" Width="480" d:LayoutOverrides="VerticalAlignment" Opacity="0" RenderTransformOrigin="0.5,0.5" Visibility="Visible" IsHitTestVisible="False" d:IsHidden="True">
				<TextBlock.RenderTransform>
					<CompositeTransform />
				</TextBlock.RenderTransform>
            Game Over
        </TextBlock>
    </Grid>
    
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</UserControl>
